package cn.diancan.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ReXUtil {

    /**
     * ///[a-z]+:\/\/[a-z0-9_\-\/.%]+/i
	String m2 = "/[a-z]+:\\/\\/[a-z0-9_\\-\\/.%]+/i";
	//System.out.println(m);
	String m3 = "http(w+)";
	String m4 ="(http://|ftp://|https://|www){0,1}[^\u4e00-\u9fa5\\s]*?\\.(com|net|cn|me|tw|fr)[^\u4e00-\u9fa5\\s]*";
     * @param args
     */
    public static void main(String[] args) {
	String m = "\\{f:\\d+\\}"; 
	
	Matcher match =Pattern.compile(m).matcher("{f:36}{f:12}{f:12}{f:12}{f:12}");
	while (match.find()) {
	  System.out.println(match.group()); 
	  int m2 = match.start() ;
	  int  m3 =match.end();
	  System.out.println(m2+""+m3);
	} 
	
    }
    
    public void f(){
	String m = "(http(s)?://)?[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?";
	
	String vv ="http://www.baidu.com/skd?casdfasdf=asdfas";
	Matcher match =Pattern.compile(m).matcher(vv);
	while (match.find()) {
	  System.out.println(match.group());
	    
	}
    }
}
